package com.yueshop.cart.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class YueshopWebConfig implements WebMvcConfigurer {


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //添加烂机器, 拦截器拦截当前服务下的所有请求
        registry.addInterceptor(new CartInterceptor()).addPathPatterns("/**");
    }
}
